package com.springBoot.springBootSysCore.modules.repository.system;

import com.springBoot.springBootSysCore.common.repository.IBaseRepository;
import com.springBoot.springBootSysCore.modules.entity.system.SysCode;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by timo on 2017/11/30.
 */
public interface SysCodeRepository extends IBaseRepository<SysCode,String>{

    @Modifying
    @Query("update SysCode set  delFlag = '1' where id in (?1)")
    public void updateDelFlag(List<String> asList);

    @Modifying
    @Query("delete from SysCode where id in (?1)")
    public void deleteByIds(List<String> asList);

    @Query("select codeValue from SysCode where type = ?1 and codeName = ?2")
    public String findCodeValueByTypeAndCodeName(String type,String codeName);
}
